package foo;

import java.util.EnumSet;

public class EnumSetSample {

	public enum WeekDay {
		MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY;

		public static final EnumSet<WeekDay>	WORKDAYS	= EnumSet.range(MONDAY, FRIDAY);

		public final boolean isWorkDay() {
			return WORKDAYS.contains(this);
		}

		public static final EnumSet<WeekDay>	THE_WHOLE_WEEK	= EnumSet.allOf(WeekDay.class);
	}
}
